/*
 * Copyright (c) 2008-2013 Haulmont. All rights reserved.
 * Use is subject to license terms, see http://www.cuba-platform.com/license for details.
 */

package com.haulmont.asu.web.ui.speciality;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 21.11.13 10:52
 */
public class SpecialityBrowser extends AbstractLookup {

    @Inject
    protected Table specialityTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        specialityTable.removeAction(getAction("specialityTable.create"));
        specialityTable.addAction(new CreateAction(specialityTable, WindowManager.OpenType.DIALOG));

        specialityTable.removeAction(getAction("specialityTable.edit"));
        specialityTable.addAction(new EditAction(specialityTable, WindowManager.OpenType.DIALOG));
    }
}
